import {useState} from 'react'
export default ()=>{
    const [count,setCount]=useState(0)

    const increment=()=>{
        console.log('-----------------',count);
        setCount((count)=>count+10)
        console.log('-----------------',count);
        setCount((count)=>count+20)
        console.log('-----------------',count);
        setCount((count)=>count+10)
        console.log('-----------------',count);
        setCount((count)=>count+5)
        console.log('-----------------',count);
       
    }
    return (<>
        <div>
            <h1>{count}</h1>
            <button onClick={increment}>+</button>
        </div>
    </>)
}